package 笔试;

import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

public class 好未来_最大正整数 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        Integer[] arr = new Integer[n];
        for (int i = 0; i < n; i++) {
            arr[i] = scan.nextInt();
        }
        Arrays.sort(arr, Collections.reverseOrder());

        int res = 0;
        for (int i = 0; i < n; i++) {
            res = res * 10 + arr[i];
        }

        System.out.println(res);
    }
}
